package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.HashMap;

@Mapper
public interface UserMapper {
    /**
     * 根据openId查询用户
     * @param openId
     * @return
     */
    @Select("select * from user where openid = #{openId}")
    User getByOpenId(String openId);

    /**
     * 新增用户
     * @param user
     * @return
     */
    int insert(User user);

    /**
     * 获取指定时间段内新增的用户数量
     * @param paramMap
     * @return
     */
    Integer getNewUserByTime(HashMap<String, Object> paramMap);

    /**
     * 获取指定时间之前的用户数量
     * @param paramMap
     * @return
     */
    Integer getTotalUserByTime(HashMap<String, Object> paramMap);
}
